Repository navigation
feat: add VideoFrame.nativeBufferColorSpace, on react-native-webgpu 0.26.0 - #11
Merged
Merged
Conversation
….26.0 The Yarn patches to react-native-webgpu and react-native-skia go away: - react-native-skia 3.11.1 ships wcandillon/react-native-skia#4510 (Dawn's AHardwareBuffer size check skipped on Android). The example moves to 3.13.1. - react-native-webgpu 0.26.0 ships wcandillon/react-native-webgpu#642: createNativeBufferFromPointer takes a colorSpace. The released option names color spaces as Dawn does ("rec709", range: "narrow"), not as WebCodecs does ("bt709", fullRange), and throws on the WebCodecs names. - The iOS 26 EDR part of the patch was not needed (wcandillon/react-native-webgpu#643 was closed). VideoFrame.nativeBufferColorSpace is the frame's colorSpace in those names, for createNativeBufferFromPointer(frame.pixelBuffer, { colorSpace }). Without it, Android reads BT.709 video with the BT.601 matrix. The README's patch instructions give way to the minimum versions.
- One ColorSpaceInit type, shared by video.ts and the mapping. - The tables are Maps: no own-property guard, and the result is built in one expression. - A type-level check in the unit test fails tsc if NativeBufferColorSpace drifts from react-native-webgpu's. - .gitignore and the CI cache key no longer name .yarn/patches. - Shorter getter docs and README version list; the explanation stays in the guide.
|
🎉 This PR is included in version 0.2.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Drops the Yarn patches to react-native-webgpu and react-native-skia, now that the changes are released (or turned out not to be needed), and adds
VideoFrame.nativeBufferColorSpace.colorSpaceoption names color spaces as Dawn does ("rec709",range: "narrow"), not as WebCodecs does ("bt709",fullRange), and throws on the WebCodecs names. Soframe.colorSpace.toJSON()can no longer be passed as is.VideoFrame.nativeBufferColorSpaceis the frame'scolorSpacein Dawn's names:Without it, Android reads BT.709 video with the BT.601 matrix. On iOS the pixel buffer has its own attachments, and passing it changes nothing. The
NativeBufferColorSpacetype is defined here, so react-native-webgpu stays a dev dependency.The README's "Temporary patches" and "Unreleased changes" sections give way to the minimum versions (WebGPU 0.26.0, Skia 3.11.1).
Tests
src/__tests__/unit/colorSpace.test.ts).yarn test:unit: 70/70.tsc(root and example) andyarn lintare clean.